<!DOCTYPE html>
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   <link rel="StyleSheet" type="text/css" href="/tpa/admin.css" />
   <link rel="StyleSheet" type="text/css" href="/tpa/jquery-ui.css" />
   <script type="text/javascript" src="/lib/js/jquery.js"></script>
   <script type="text/javascript" src="/lib/js/jquery.ui.js"></script>
   <script type="text/javascript" src="/lib/js/meccano.js"></script>
</head>
<body>
<div align="center">

   <form action="/admin/{%$categories[12]->alias%}.php" method="post">
      <div style="border: #377A00 solid 1px;padding:10px;width:500px;margin-top:30px;">
         <input type="text" name="search" style="width:250px;" value="{%$search_str|default:''%}" />
         <input type="submit" value=" {%$TR->meccano->search%} " name="commit" />
      </div>
   </form>
   <br />

   {%if $data%}

   {%foreach from=$data item='a' name='i'%}
   {%if $smarty.foreach.i.first%}
   <form action="/admin/{%$categories[12]->alias%}.php" method="post">
   <input type="hidden" name="search" value="{%$search_str|default:''%}" />
   <table border="0" cellspacing="0" width="100%" id='data' class="grid">
      <tr>
         <th width="3%">ID:</th>
         <th>{%$TR->meccano->title%}:</th>
         <th width="15%">{%$TR->meccano->deleted%}:</th>
         <th width="7%">{%$TR->meccano->delete%}:</th>
         <th width="7%">{%$TR->meccano->recover%}:</th>
      </tr>
   {%/if%}
      <tr {%cycle values=",class='odd'"%}>
         <td class="ct" align="center">{%$a->id%}</td>
         <td><a href="javascript:void(0);" onclick="viewMore({%$a->id%});">{%$a->title%}</a><br />
            <div style="display:none;" id="more_{%$a->id%}">
               <i>{%$a->category->title%}</i> {%$a->sdate%}<br />
               {%$a->description|default:$a->body|strip_tags|utf8_substr:0:400%}
            </div>
         </td>
         <td class="rt">{%$a->deleted|date_format:'%d.%m.%Y %H:%M'%}</td>
         <td align="center"><input type="checkbox" name="delete[]" value="{%$a->id%}" /></td>
         <td align="center"><input type="checkbox" name="recover[]" value="{%$a->id%}" /></td>
      </tr>
   {%if $smarty.foreach.i.last%}
   </table>

   <div style="padding:5px;">
      {%if $pages%}
      <div>
         {%$TR->meccano->records%}: {%$data|@count%} {%$TR->meccano->from%}: {%$pages.found%}
      </div>
      <div class="paginator">
         {%foreach from=$pages.links item='p'%}
         {%if $p.current%}<span class="warn">{%$p.num%}</span>
         {%else%}<a href="{%$p.href%}">{%$p.num%}</a>
         {%/if%}
         {%/foreach%}
      </div>
      {%/if%}
   </div>


   <div style="float:right;margin: 5px;" align="right">
      <input type="submit" name="commit" value=" {%$TR->meccano->save%} " onclick="return window.confirm('{%$TR->meccano->delalert%}');" />
   </div>

   </form>

   {%/if%}
   {%/foreach%}

   {%else%}
   <div class="warn" style="padding: 50px;">{%$TR->meccano->nothingfind%}</div>
   {%/if%}

</div>
   <script type="text/javascript">
      function viewMore(id)
      {
         $('#more_'+id).slideToggle();
      }
   </script>
</body>
</html>